<%--
  Created by IntelliJ IDEA.
  User: Lenovo
  Date: 2024/10/29
  Time: 20:31
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
    <title>list</title>
    <link rel="stylesheet" href="/static/layui/css/layui.css">
    <style>
        th {
            width: 80px;
            height: auto;
            text-align: left;
        }
    </style>
</head>
<body>
<form action="/student/list/1" method="post">
    <div class="layui-form-item">
        <div class="layui-inline">
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" placeholder="请输入学号" name="studentNum" value="${student.studentNum}"
                       class="layui-input">
            </div>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" placeholder="请输入姓名" name="studentName" value="${student.studentName}"
                       class="layui-input">
            </div>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" placeholder="请输入性别" name="gender" value="${student.gender}"
                       class="layui-input">
            </div>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" placeholder="请输入年龄" name="age" value="${student.age}" class="layui-input">
            </div>

            <button type="submit" class="layui-btn" lay-submit lay-filter="demo1">查询</button>
            <a class="layui-btn" href="/student/toadd">新增用户</a>
        </div>
    </div>
</form>
<table class="layui-table" lay-even id="table">
    <colgroup>
        <%--        编号--%>
        <col width="170">
        <%--        学号--%>
        <col width="170">
        <%--        姓名--%>
        <col width="170">
        <%--        性别--%>
        <col width="170">
        <%--        年龄--%>
        <col width="170">
        <%--        生日--%>
        <col width="170">
        <%--        班级--%>
        <col width="170">
        <%--        宿舍--%>
        <col width="170">
        <%--        电话--%>
        <col width="170">
        <%--        邮箱--%>
        <col width="170">
        <%--        专业--%>
        <col width="350">
        <%--        修改时间--%>
        <col width="170">
        <%--        备注--%>
        <col width="170">
        <%--        操作--%>
        <col width="250">
    </colgroup>
    <thead>
    <tr>
        <th>编号</th>
        <th>学号</th>
        <th>姓名</th>
        <th>性别</th>
        <th>年龄</th>
        <th>生日</th>
        <th>班级</th>
        <th>宿舍</th>
        <th>电话</th>
        <th>邮箱</th>
        <th>住址</th>
        <th>紧急联系人电话</th>
        <th>紧急联系人姓名</th>
        <th>专业</th>
        <th>状态</th>
        <th>删除状态</th>
        <th>创建人</th>
        <th>创建时间</th>
        <th>修改人</th>
        <th>修改时间</th>
        <th>备注</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${students}" var="s">
        <tr>
            <td>${s.id}</td>
            <td>${s.studentNum}</td>
            <td>${s.studentName}</td>
            <td><c:if test="${s.gender=='0'}">男</c:if>
                <c:if test="${s.gender=='1'}">女</c:if>
                <c:if test="${s.gender=='2'}">保密</c:if>
            </td>
            <td>${s.age}</td>
            <td><fmt:formatDate value="${s.dateOfBirth}" pattern="yyyy-MM-dd"/></td>
            <td>${s.classId}</td>
            <td>${s.hostelId}</td>
            <td>${s.phone}</td>
            <td>${s.email}</td>
            <td>${s.homeAddress}</td>
            <td>${s.emergencyContact}</td>
            <td>${s.emergencyContactPhone}</td>
            <td>${s.major}</td>
            <td><c:if test="${s.status=='0'}">在读</c:if>
                <c:if test="${s.status=='1'}">毕业</c:if>
            </td>
            <td><c:if test="${s.delFlag=='0'}">未删除</c:if>
                <c:if test="${s.delFlag=='1'}">已删除</c:if>
            </td>

            <td>${s.createBy}</td>
            <td>${s.createTime}</td>
            <td>${s.updateBy}</td>
            <td>${s.updateTime}</td>
            <td>${s.remark}</td>
            <td>
                <a class="layui-btn " href="/student/toupdate/${s.id}">编辑</a>
                <c:if test="${s.delFlag==0||s.delFlag==null}">
                    <a class="layui-btn " href="/student/disable/${s.id}">禁用</a>
                </c:if>
                <c:if test="${s.delFlag==1}">
                    <a class="layui-btn" href="/student/restore/${s.id}">恢复</a>
                </c:if>
                <a class="layui-btn " href="/student/delete/${s.id}">删除</a>

            </td>
        </tr>
    </c:forEach>
    <tr>
        <td colspan="22">
            <a href="/student/list/1">首页</a>
            <c:if test="${page.currentPage != 1}">
                <a href="/student/list/${page.currentPage-1}">上一页</a>
            </c:if>
            &nbsp;第${page.currentPage}页/总${page.totalPage}页&nbsp;
            <c:if test="${page.currentPage != page.totalPage}">
                <a href="/student/list/${page.currentPage+1}">下一页</a>
            </c:if>
            <a href="/student/list/${page.totalPage}">尾页</a>
        </td>
    </tr>
    </tbody>
</table>

</body>
</html>
